//
//  FQDBlurView.m
//  FakeQDaily
//
//  Created by mewxiv on 9/18/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "FQDBlurView.h"

#import "Masonry.h"

@implementation FQDBlurView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self prepareUI];
    }
    return self;
}

- (void)prepareUI
{
    self.clipsToBounds = YES;
    
    UIToolbar *toolbar = [[UIToolbar alloc] init];
    toolbar.translucent = YES;
    toolbar.barStyle = UIBarStyleBlack;
    [self addSubview:toolbar];
    
    WeakSelf;
    [toolbar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(weakSelf);
    }];
    
    UIView *maskView = [[UIView alloc] init];
    maskView.backgroundColor = [UIColor blackColor];
    maskView.alpha = 0.5f;
    [self addSubview:maskView];
    
    [maskView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(weakSelf);
    }];
}

@end
